package com.lld.im.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

/**
 * ImTcp层配置类
 */
@Data
@Component
@ConfigurationProperties(prefix = "im")
public  class ImTcpConfig {
    private Integer tcpServerPort;

    private Integer websocketPort;
    private Integer bossGroupPoolSize;

    private String brokerId;

    private Integer loginMode;

    private String msgRpcUrl;

    /**
     * 心跳检测时间 毫秒
     */
    private Integer idleHeartTime;
    private Integer workGroupPoolSize;

    @NestedConfigurationProperty
    private ZkConfig zkConfig=new ZkConfig();

    @NestedConfigurationProperty
    private RedisConfig redisConfig=new RedisConfig();



    @Data
    public static class ZkConfig{
        private String address;
        private int connectOutTime;
        private Integer routeWay;
        private Integer port;
    }


    @Data
    public static class RedisConfig{
        private String host;
        private Integer port;
    }
}
